getQueryString = function(name) {
	try {
		var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
		var r = decodeURI(window.location.href)
			.split("?")[1]
			.match(reg);
		if (r != null) return unescape(r[2]);
		return null;
	} catch (e) {
		return null;
	}
};
// var baseUrl = 'http://192.168.1.139:7080/jeefast';
// var ImgbaseUrl = 'http://192.168.1.139:7080/jeefast/';
// var uploadPic="http://192.168.1.139:7080/jeefast/upload/upload?token="+ 'admin';   // 上传图片接口
// var uploadPic = "https://jsonplaceholder.typicode.com/posts/";  //测试

var baseUrl = '/jeefast';
var ImgbaseUrl = '';
var uploadPic="/jeefast/upload/upload?token="+ localStorage.getItem("token");   // 上传图片接口
var token=localStorage.getItem("token");

axios.interceptors.request.use((request) => {

	const token = localStorage.getItem("token");
	if (request.params) {
		request.params.token = token;
	}
	if (request.data) {
		request.data.token = token;
	}
	return request;
});
var axiosPostOption = {
	headers: {
		'Content-Type': 'application/x-www-form-urlencoded'
	},
	transformRequest: [
		function(data) {
			let ret = '';
			for (let it in data) {
				ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&';
			}
			return ret;
		}
	]
}
var axiosJson = {
	headers: {
		'Content-Type': 'application/json'
	}
}
var mix = {
	data: function() {
		return {
			// 分页
			page: 1, //总页数
			limit: 10, //每页显示个数
		}
	},
	methods: {
		
	},
	mounted: function() {

	}
}
// 项目列表
function projList(params) {
	return axios.post(baseUrl + '/mbProj/list', params, axiosPostOption);
}
// 项目详情
function projDetail(params) {
	return axios.post(baseUrl + '/mbProj/detail', params, axiosPostOption);
}
// 删除项目
function projDelete(params) {
	return axios.post(baseUrl + '/mbProj/delete', params, axiosPostOption);
}
// 添加或编辑项目
function addOrSave(params) {
	return axios.post(baseUrl + '/mbProj/addOrSave', params, axiosPostOption);
}
// 医学专员列表
function commissionerList(params) {
	return axios.post(baseUrl + '/mbCommissioner/list', params, axiosPostOption);
}
// 添加或修改专员信息
function commissionerAddOrSave(params) {
	return axios.post(baseUrl + '/mbCommissioner/addOrSave', params, axiosPostOption);
}
// 删除医学专员
function commissionerDelete(params) {
	return axios.post(baseUrl + '/mbCommissioner/delete', params, axiosPostOption);
}
// 研究组列表
function researchList(params) {
	return axios.post(baseUrl + '/mbResearch/list', params, axiosPostOption);
}
// 添加或编辑研究组
function researchAddOrSave(params) {
	return axios.post(baseUrl + '/mbResearch/addOrSave', params, axiosPostOption);
}
// 删除研究组
function researchDelete(params) {
	return axios.post(baseUrl + '/mbResearch/delete', params, axiosPostOption);
}
// 研究阶段列表
function researchStepList(params) {
	return axios.post(baseUrl + '/mbResearchStep/list', params, axiosPostOption);
}
// 删除研究阶段
function researchStepDelete(params) {
	return axios.post(baseUrl + '/mbResearchStep/delete', params, axiosPostOption);
}
// 模板列表
function templateList(params) {
	return axios.post(baseUrl + '/mbResearchStrpDataTemplate/list', params, axiosPostOption);
}
// 模板详情
function templateDetail(params) {
	return axios.post(baseUrl + '/mbResearchStrpDataTemplate/detail', params, axiosPostOption);
}
// 批量添加或修改主要指标
function miAddOrUpdate(params) {
	return axios.post(baseUrl + '/mbResearchStepDataTemplateMainIndicators/addOrUpdate?token='+token, params,axiosJson);
}
// 批量添加或修改客观指标
function oiAddOrUpdate(params) {
	return axios.post(baseUrl + '/mbResearchStepDataTemplateObjectiveIndicators/addOrUpdate?token='+token, params, axiosJson);
}
// 批量添加或修改其他指标
function aiAddOrUpdate(params) {
	return axios.post(baseUrl + '/mbResearchStepDataTemplateAnotherIndicators/addOrUpdate?token='+token, params, axiosJson);
}
// 研究阶段详情
function researchStepDetail(params) {
	return axios.post(baseUrl + '/mbResearchStep/detail', params, axiosPostOption);
}
// 添加或编辑研究阶段
function researchStepAddOrSave(params) {
	return axios.post(baseUrl + '/mbResearchStep/addOrSave', params, axiosPostOption);
}
// 添加或编辑模板
function templateAddOrSave(params) {
	return axios.post(baseUrl + '/mbResearchStrpDataTemplate/addOrSave', params, axiosPostOption);
}
// 数据分析列表
function researchDataDetail(params) {
	return axios.post(baseUrl + '/mbResearchData/dataDetail', params, axiosPostOption);
}
// 数据分析—生化指标管理（上半部分基础信息）
function researchDataInfo(params) {
	return axios.post(baseUrl + '/mbResearchData/info', params, axiosPostOption);
}
// 审核拒绝
function researchDataRefuse(params) {
	return axios.post(baseUrl + '/mbResearchData/refuse', params, axiosPostOption);
}
// 生化指标详情
function researchSetpDataDetail(params) {
	return axios.post(baseUrl + '/mbResearchSetpDataDetail/detail', params, axiosPostOption);
}
// 保存数据
function researchSetpDataUpdate(params) {
	return axios.post(baseUrl + '/mbResearchSetpDataDetail/update?token='+token, params, axiosJson);
}
// 审核通过
function researchDataAccept(params) {
	return axios.post(baseUrl + '/mbResearchData/accept', params, axiosPostOption);
}
// 反馈列表 
function feedbackList(params) {
	return axios.post(baseUrl + '/mbFeedback/list', params, axiosPostOption);
}
// 获取慢病基础信息
function resBsaseInfoList(params) {
	return axios.post(baseUrl + '/mbResBsaseInfo/list', params, axiosPostOption);
}
// 编辑或添加基础信息是否必填参数
function resBsaseInfoAddOrSave(params) {
	return axios.post(baseUrl + '/mbResBsaseInfo/addOrSave', params, axiosPostOption);
}
// 治疗计划  
function treatmentPlanList(params) {
	return axios.post(baseUrl + '/mbTreatmentPlan/list', params, axiosPostOption);
}
function treatmentPlanDelete(params) {
	return axios.post(baseUrl + '/mbTreatmentPlan/delete', params, axiosPostOption);
}
function treatmentPlanAddOrSave(params) {
	return axios.post(baseUrl + '/mbTreatmentPlan/addOrSave', params, axiosPostOption);
}
// 透析方式
function dialysisWayList(params) {
	return axios.post(baseUrl + '/mbDialysisWay/list', params, axiosPostOption);
}
function dialysisWayDelete(params) {
	return axios.post(baseUrl + '/mbDialysisWay/delete', params, axiosPostOption);
}
function dialysisWayAddOrSave(params) {
	return axios.post(baseUrl + '/mbDialysisWay/addOrSave', params, axiosPostOption);
}





